package cn.wires.lu.charts.controller;


import cn.wires.lu.charts.entity.FundBaseInfo;
import cn.wires.lu.charts.sao.ChartsFeign;
import com.netflix.hystrix.contrib.javanica.annotation.DefaultProperties;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/charts")
@DefaultProperties
public class ChartsController {

    @Autowired
    private ChartsFeign chartsFeign;

    @GetMapping(value = "/{id}")
    @HystrixCommand
    public FundBaseInfo findById(@PathVariable Integer id){
        return  chartsFeign.findById(id);
    }

    @GetMapping(value = "/test/{id}")
    public String testH(@PathVariable Integer id){
        return "GOGOGOGO";
    }


}
